package cn.b504.qpcr.entity.data

data class MeltData(var data: List<List<Float>> = ArrayList(),
                    var startTemperature: Float = 60F,
                    var gradient: Float = 95F)

data class QuantificationData(var channel1: List<List<Float>> = getEmptyChannel(),
                              var channel2: List<List<Float>> = getEmptyChannel(),
                              var channel3: List<List<Float>> = getEmptyChannel(),
                              var channel4: List<List<Float>> = getEmptyChannel(),
                              var channel5: List<List<Float>> = getEmptyChannel(),
                              var channel6: List<List<Float>> = getEmptyChannel()) {

  fun setChannel(i: Int, list: List<List<Float>>) {
    when (i) {
      0 -> channel1 = list
      1 -> channel2 = list
      2 -> channel3 = list
      3 -> channel4 = list
      4 -> channel5 = list
      5 -> channel6 = list
    }
  }

  fun getChannel(i: Int): List<List<Float>> {
    return when (i) {
      0 -> channel1
      1 -> channel2
      2 -> channel3
      3 -> channel4
      4 -> channel5
      5 -> channel6
      else -> java.util.ArrayList()
    }
  }
}

private fun getEmptyChannel(): List<List<Float>> {
  val lists: MutableList<List<Float>> = ArrayList()
  // 初始化 96 个孔
  for (i in 0 until PcrData.POSITION_NUMBER) {
    lists.add(ArrayList())
  }
  return lists;
}